<script lang="ts" setup>
// 主要展现对话部分和预览文件部分
import { computed } from 'vue'
import { NGi, NGrid } from 'naive-ui'
import Chat from '@/views/pdf/chat/index.vue'
import { PDFViewer } from '@/components/common'
import { useLocalKnowledgeHubState } from '@/store'

const localKnowledgeHubState = useLocalKnowledgeHubState()

// 利用计算属性获取pdf文件路径
const pdfSrc = computed(() => {
  // 读取pinia中的pdfSrc
  return localKnowledgeHubState.pdfSrc
})
</script>

<template>
  <NGrid class="h-full" :x-gap="10">
    <NGi span="14">
      <Chat />
    </NGi>
    <NGi span="10">
      <PDFViewer :pdf-src="pdfSrc" />
    </NGi>
  </NGrid>
</template>
